import olt业务配置
import 排序分公司

if __name__ == '__main__':
    import pandas as pd

    df = pd.read_csv("D:\\家宽\\基表\\基表0228.csv", usecols=['account', 'olt_pon'])
    df['管理IP'] = df['olt_pon'].str.split('-').str[0]
    olt = pd.read_csv('D:\\中断输入\\OLT业务表的配置查询结果.csv', usecols=['管理IP', '分公司'])
    df = df.merge(olt, on='管理IP')
    gigabitUsers = pd.read_csv("/家宽/gigabitUsers.csv")
    gigabitUsers = df[df['account'].isin(gigabitUsers['account'])]
    df = df.value_counts('分公司').reset_index()
    print(df)
    gigabitUsers = gigabitUsers.value_counts('分公司').reset_index()
    print(gigabitUsers)
    df = df.merge(gigabitUsers, on='分公司')
    df = 排序分公司.order(df)
    df.to_excel("D:\\家宽\\分公司人数.xlsx", index=False)
